/*
* $Id: TransactManager.cpp 302 2011-04-08 15:18:13Z volok-aleksej@yandex.ru $
*
* Copyright 2009-2011 by Volokitin Aleksey
* All rights reserved
*
*/
#include "Common/include.h"
#include "TransactManager.h"
#include "Database/InterfaceDb.h"

CTransactManager::CTransactManager(){}
CTransactManager::~CTransactManager(){}

void CTransactManager::AddIDMap(ID idMap, int realId){
	m_aIDMap.insert(std::make_pair(idMap, realId));
}

int CTransactManager::GetRealId(ID idMap, bool* bExist){
	std::map<ID, int>::iterator it = m_aIDMap.find(idMap);
	bool exist = false;
	int id = idMap.m_id;
	if(it != m_aIDMap.end()){
		exist = true;
		id = it->second;
	}
	if(bExist)
		*bExist = exist;
	return id;
}

